package com.action;

import java.util.List;

import com.Entity.User;
import com.Service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.context.annotation.Scope;

import org.springframework.stereotype.Controller;



@Controller()

@Scope("prototype")

public class LoginAction {

@Autowired

private UserService userService;

private User user;

public User getUser() {

        return user;

        }

        public void setUser(User user) {

        this.user = user;

        }

public String login() {

        List<User> u=  userService.login(user);

        if(u.size()>0) {

        return"success";

        }

        else{

        return"error";

        }

        }

        }